package example.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 李俊
 * @Description
 * @Date 2021/7/14 15:47
 */

@RestController
public class EchoController {

    @Autowired
    private Environment environment;


    @GetMapping(value = "/echo/{string}")
    public String echo(@PathVariable String string) {
        return "Hello Nacos Discovery " + string +"; port :" +   environment.getProperty("local.server.port");
    }
}
